<?php

use Facebook\FacebookSession;
use Facebook\FacebookRedirectLoginHelper as FHelper;
use Facebook\FacebookRequest;
use Facebook\GraphUser;

class IndexController extends ControllerBase
{

    public function indexAction()
    {
   

   		if($this->session->get('user_id') != null)
   		{
        $info = UserAccountTb::findFirstById($this->session->get('user_id'));
        if($info == true)
        {
            if($info->activated == 0)
            {
              //header("Location: ".BASE_URI.'registration/confirm?ea='.$info->email);
            }
            else
            {
              if(!$info->password){
                header('Location:'.BASE_URI.'registration/step_1');  
              }
              else
              {
                header('Location:'.BASE_URI.'profile?bhd='.$this->session->get('user_id'));         
              }
              
            }
        } 			
   		}

      $this->view->setVar('page_name', 'Index');
    	$this->view->setVar('content','index/index');
    }
    public function aboutAction()
    {
    $this->view->setMainView('index');
    $this->view->setVar('page_name', 'Forum');
    $this->view->setVar('content', 'index/about');
    $this->view->setVar('title', '');
    }

}

